Skip to content

Comments

[http] autorefesh after sending command to update…#17271

Merged
lsiepel merged 11 commits intoopenhab:mainfrom
constambeys:main
Nov 1, 2025
Merged

[http] autorefesh after sending command to update…#17271
lsiepel merged 11 commits intoopenhab:mainfrom
constambeys:main

Conversation

@constambeys
Copy link
Contributor

Hello,

In my openhab configuration I have multiple items bound to the same channel and when sending command only one item gets updated and the rest are updated after the refresh timeout passes.

I have modified the code to force update after sending command

Thanks
Timotheos Constambeys

… channel state

Signed-off-by: Timotheos Constambeys <timo0190@gmail.com>
@constambeys constambeys requested a review from a team as a code owner August 17, 2024 10:08
Signed-off-by: Timotheos Constambeys <timo0190@gmail.com>
@lolodomo lolodomo added the enhancement An enhancement or new feature for an existing add-on label Aug 18, 2024
@J-N-K
Copy link
Member

J-N-K commented Aug 18, 2024

I don't think a general "refresh after command" is a desired function. Depending on the attached device it may also fail (e.g. when updating the internal state in the device takes longer than it takes the binding to issue the state request).

Can you show describe what exactly you are doing? What items are connected to the channel, why are there several items, do you send commands to all items (or only one) and what exactly do you expect to happen? At best, show the thing or at least the channel configuration.

@J-N-K J-N-K self-assigned this Aug 18, 2024
@constambeys
Copy link
Contributor Author

Yes,

I have the following configuration for an LED strip:

Thing UID: http:url:2bcdb351df
Base URL: http://192.168.10.11/
....
Channel UID: http:url:2bcdb351df:led0
State URL Extension: state
Command URL Extension: set?status=%2$s
On Value: 1
Off Value: 0
Increase/Decrease Step 1
Color Mode RGB

And 3 items bound to the channel

  • Switch
  • Dimmer
  • Color

@J-N-K
Copy link
Member

J-N-K commented Aug 19, 2024

Why do you need three items for that? The Color item accepts all commands that Switch or Dimmer accept.

@constambeys
Copy link
Contributor Author

In the color item I see only three bars for Hue, Saturation, Brightness how can I do the rest?

@constambeys constambeys changed the title [org.openhab.binding.http] autorefesh after sending command to update… [http] autorefesh after sending command to update… Aug 22, 2024
@J-N-K
Copy link
Member

J-N-K commented Aug 28, 2024

Which UI?

@constambeys
Copy link
Contributor Author

Am not sure is the default UI !

  - component: oh-toggle-card
    config:
      item: Backlight_LED

 - component: oh-slider-card
    config:
      item: Backlight_LED_Dimmer
      label: true
      scale: true
      scaleSubSteps: 5

  - component: oh-colorpicker-card
    config:
      item: Backlight_LED_Color
      sliderLabel: true

@J-N-K
Copy link
Member

J-N-K commented Aug 30, 2024

I didn't check, but can't you link Backlight_LED_Color in the oh-toggle-card? That should work. If it is not possible, that's an UI bug.

@constambeys
Copy link
Contributor Author

My friend, I have checked what you have suggested and it works the same.

However when triggering a command the state of the channel is not updated (a refresh command has to be fired)
e.g. from off to on the color and brightness items do not know the exact value since the command triggered is only "turn on" !

Anyway the refresh ability is already implemented what I have suggested is to trigger it quicker than waiting the timeout timer to be passed ! Other protocols like Tuya do the same thing, a feedback from the device is updating the state after a command is fired check my repo: https://github.com/constambeys/openhab-addons-tuya

@J-N-K
Copy link
Member

J-N-K commented Aug 31, 2024

I still don't understand why this is necessary, but we can add it. However, it should be configurable with a default behavior that is the same as the current one.

@constambeys constambeys requested a review from J-N-K as a code owner December 31, 2024 11:15
constambeys and others added 2 commits May 16, 2025 21:20
…ding/http/internal/HttpThingHandler.java

Co-authored-by: lsiepel <leosiepel@gmail.com>
Signed-off-by: Timotheos Constambeys <timo0190@gmail.com>
@lsiepel
Copy link
Contributor

lsiepel commented Jul 15, 2025

@constambeys to get this merged i suggest we make this configurable.
With a simple configuration parameter refreshAfterCommand that defaults to false when set to false, the old behaviour applies. Agree? Let me know if you need any help.

@constambeys
Copy link
Contributor Author

Is it ok ?

@lsiepel
Copy link
Contributor

lsiepel commented Oct 20, 2025

Thanks for updating this PR. I think this is ready, just one minor thing is left and that is to add this configuration parameter to the readme.md

@lsiepel lsiepel merged commit 5a80d1b into openhab:main Nov 1, 2025
2 checks passed
@lsiepel lsiepel added this to the 5.1 milestone Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature for an existing add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants